package com.example.administrator.activity.Homework.Homework6.homework_2;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.support.annotation.Nullable;
import android.util.Log;

public class Myheleper1 extends SQLiteOpenHelper {
    public Myheleper1(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
        Log.v("sqlite","构造方法");
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
    String sql="CREATE TABLE study\n" +
            "(\n" +
            "    id integer  PRIMARY KEY AUTOINCREMENT,\n" +
            "    NAME VARCHAR(50),pass varchar(50) \n" +
            ")";
    db.execSQL(sql);
    Log.v("sqlite","onCreate方法");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    }
}
